const express = require('express')
const app = express()

function postFile(req, res, next) {
    req.file = { name: '自己上传的文件' }
    next()
}



app.get('/hero', (req, res) => {
    console.log(req.file);
    res.send('查询英雄')
})

app.post('/upload', postFile, (req, res) => {
    console.log(req.file);
    res.send('上传成功')
})


app.listen(8000, () => {
    console.log('8000开启成功');
})